<template>
  <div class="answers">
    <div class="header_zc_list">
      <h4 class="header_zc_personal_details">我的信息</h4>
      <ul class="header_zc_list_ul">
        <li class="header_zc_list_item" @click="showUserInfo(userInfo.userName,15)">个人信息</li>
        <li class="header_zc_list_item" @click="showUserDeptInfo(userInfo.partyOrgName,15)">所在支部</li>
        <li class="header_zc_list_item" @click="gotoOtherApp()">亲情网格</li>
      </ul>
      <!--功能还没做好。暂时隐藏-->
      <template>
        <h4 class="header_zc_personal_details">红色基地研学</h4>
        <ul class="header_zc_list_ul">
          <li class="header_zc_list_item" @click="redBase('communicationLine')">党业融合研学交流路线</li>
          <li class="header_zc_list_item" @click="redBase('educationBase')">红色文化教育基地</li>
        </ul>
      </template>
    </div>
  </div>


</template>

<script>
import getTime from '@/utils/getTime.js'
import {mapState} from "vuex";
import {setQueryDepts, setQueryUsers} from "../../../utils/setChatStoreData";
import AesGcm from "@/utils/aesgcm";

export default {
  name: "HeaderZC",
  props: ['aiContent'],
  computed: {
    ...mapState(['userInfo', 'rhPlate', 'robotInfo']),
    getTimes() {
      return getTime();
    }
  },

  methods: {
    showUserInfo(username, size) {
      setQueryUsers(this, username, null, size);
    },
    showUserDeptInfo(orgName, size) {
      setQueryDepts(this, orgName, size);
    },
    gotoOtherApp(){
      const mxSsoToken = localStorage.getItem("mx_sso_token");
      MXCommon.openUrlPage(AesGcm.decrypt(process.env.VUE_APP_ZC_GRID_URL) + mxSsoToken);
    },
    /**
     * 跳转红色基地
     * @param type 路由ID
     */
    redBase(type){
      this.$store.commit('redBase/setRouter',type);
      this.$router.push({
        name:'RedBase',
        query:{
          navIOSColor:"B12223"
        }
      })
    }
  }
}

</script>

<style scoped>
@import url("~@/assets/css/homeDJHeader/HeaderZC.css");
</style>
